<%@page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="html" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<html:header title="新增收支项目">

    <link rel="stylesheet" href="${baseUrl}css/public.css" media="all">
    <style type="text/css">
        .readonly{
            background-color: #eeeeee;
        }

        a{
            color: #01AAED;
            text-decoration: none;
            font-size: 12px;
        }
        a:hover {
            color: #FF5722;
        }
    </style>
    <script>
        jQuery(function () {
            $("#cancel").click(function () {
                closeSubIframe();
            });
        });

        layui.use(['form', 'table','laydate'], function () {
            var $ = layui.jquery,
                form = layui.form,
                laydate = layui.laydate,
                table = layui.table;

            form.on('submit(save)', function (data) {
                if (data.field.name == "") {
                    tip("名称不能为空");
                    return false;
                }

                tipLoad();
                post("${baseUrl}budget/budgetProject/add.action", data.field,function (resp) {
                    closeAll();
                    if (resp.code == 1) {
                        closeSubIframe();
                        refreshMainIframe("${baseUrl}budget/budgetProject.action");
                    } else {
                        closeLoading();
                        tip(resp.msg);
                    }
                });

                return false;
            });

        });
    </script>

</html:header>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <form class="layui-form" action="" lay-filter="budgetProject">

            <div class="layui-form-item">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" placeholder="名称" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">收支类别</label>
                <div class="layui-input-inline">
                    <select name="type">
                        <option value="1">收入</option>
                        <option value="2">支出</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline">
                    <textarea name="remark" placeholder="备注" class="layui-textarea"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="save">保存</button>
                    <button class="layui-btn layui-btn-primary" id="cancel">取消</button>
                </div>
            </div>
        </form>
    </div>
</div>

</body>
<html:loading/>

</html>